

<link rel="stylesheet" type="text/css" href="{$_G['URL']['APP_CSS']}friend.css?v=2" />

<!--底部弹出电话-->
<div class="radios_nav">
  <div id="outer_container" class="outer_container">
    <a class="menu_button3" style="background-color: {$config['formcolortop']};" onclick="showkfewm()" href="javascript:;" title="Toggle"><span>客服</span></a>
  </div>
</div>

<div id="friendhelp"></div>
{if !empty($help_uid) && !empty($friendfans['username'])}
<div class="content text_center star" style="background: #ffffff;" id="light">
  <div class="content star_wrap" style="background: #ffffff;">
    <ul class="content" style="padding-top: 10px; margin-top: 10px; padding-bottom: 8px; background: none;">
    {if $isfriend == 0}
      {if empty($config['friend_wait'])}
        <a class="new_light " href="javascript:;" onclick="dofriendhelp({$help_uid})" ><span style="jlink">{$config['friend_anniu']}</span></a>
      {else}
        <input type="button" class="new_light " style=" border: 0; color: #D9D9D9" id="btnfriendhelp" value="{$config['friend_anniu']}(需等{$config['friend_wait']}秒)" onclick="dofriendhelp({$help_uid})" disabled="disabled" />
      {/if}
    {else}
      <a class="new_light" href="javascript:;" >{$config['friend_success']}</a>
      {/if}
    </ul>
  </div>
</div>
{/if}
<div id="friendhelp2"></div>

{if $friendlistuid == $_G['member']['uid']}

    <script type="text/javascript">

function showduihuan(limitnum,giftid){
  var info = '您有 {$friendshengyu} {$config['friend_unit']}，本次兑换需要 ' + limitnum +' 颗。';
  var shengyu = {$friendshengyu};
  if (shengyu < limitnum){
    info = info + '继续邀请好友，才可以来兑换噢';
  }else{
    info = info + '点击我要兑换，即可确认';
  }
  
  showduihuaninfo(info,giftid);

}
function showduihuaninfo(info,giftid){

  $("#giftid").val(giftid);
  $("#giftinfotext").text(info);
  $(".giftinfo").removeClass("popup-hidden").addClass("popup-showing active");
}
function closeduihuaninfo(){
  $(".imginfo").removeClass("popup-showing active").addClass("popup-hidden");
  $(".giftinfo").removeClass("popup-showing active").addClass("popup-hidden");
    $(".imgposter").removeClass("popup-showing active").addClass("popup-hidden");
}
$(".popup-mask").on("click", function(){
  closeduihuaninfo();
});


          function dofriendexchange(){
            var giftid = $('#giftid').val();
              closeduihuaninfo();
            var nowurl = window.location.href.replace(/#/g,"&");
             $.ajax({
                  type: 'GET',
                  dataType : "json",
                  url:'/{php echo createMobileUrl("friendexchange",array("themeid"=>$themeid));}&giftid=' + giftid,
                  success: function(data) {
                      data = data.message;
                      if(data.errcode == 1){
                        tips2(data.msg,nowurl);
                     }else{
                        tips(data.msg);
                     }
                  },
                  error: function() {
                  }
              });
          }  
    </script> 

<style type="text/css">
#mcover7 {position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: none; z-index: 100002; }
#mcover7 img {position: fixed; right: 18px; top: 5px; width: 260px !important; height: 180px !important; z-index: 100002; }
</style>
<div id="mcover7" onclick="document.getElementById('mcover7').style.display='';">
<img src="{if empty($config['gifttip'])}{$_G['URL']['APP_IMAGE']}fenxiao14.png{else}{php echo tomedia($config['gifttip']);}{/if}" /></div>
<script type="text/javascript">
$(function(){
  $(".letgo7").click(function(event) {
    $("#mcover7").show();
    return false;
  });
})
</script>

{/if}

<script type="text/javascript">
  
          function dofriendhelp(uid){
            var nowurl = window.location.href.replace(/#/g,"&");
             $.ajax({
                  type: 'GET',
                  dataType : "json",
                  url:'/{php echo createMobileUrl("friendhelp",array("themeid"=>$themeid));}&uid=' + uid,
                  success: function(data) {
                      data = data.message;
                      if(data.errcode == 1){
                        tips2(data.msg,nowurl);
                     }else{
                        tips(data.msg);
                     }
                  },
                  error: function() {
                  }
              });
          }  

</script>


{if !empty($help_uid) && !empty($friendfans['username'])}
  {if $isfriend == 0 && !empty($config['friend_wait'])}

    <script type="text/javascript">

      var tim= {$config['friend_wait']} - 1 ;
      function friendhelptime(){
        var btnn=document.getElementById("btnfriendhelp");
        if(tim<=0)
        {
          btnn.value="{$config['friend_anniu']}";
          btnn.disabled="";
          btnn.style="border: 0; color: {php echo empty($config['startextcolor'])?'#ffffff':$config['startextcolor'];}";
        }
        else
        {
          btnn.value="{$config['friend_anniu']}(需等"+tim+"秒)";
          tim--;
        }
      }
      setInterval("friendhelptime()",1000);

    </script> 
   {/if}
{/if}

